﻿using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;

namespace RotaractProjectCalendar.Models
{
    public class Coordinator
    {
        public int Id { get; set; }
        
        [Display(Name = "Club name")]
        [Required]
        public int ClubId { get; set; }
        
        [Display(Name = "Imię")]
        [Required(ErrorMessage = "Name is required!")]
        [MaxWords(1)]
        [StringLength(15, ErrorMessage = "Name cannnot be longer than 15 characters.")]
        public string Name { get; set; }
        
        [Display(Name = "Numer kontaktowy")]
        [DataType(DataType.PhoneNumber)]
        [StringLength(12, ErrorMessage = "Phone number cannnot be longer than 12 characters.")]
        public string PhoneNumber { get; set; }
        
        [Display(Name = "Adres e-mail")]
        [Required(ErrorMessage = "Email address is required!")]
        [DataType(DataType.EmailAddress)]
        [StringLength(40, ErrorMessage = "Email address name cannnot be longer than 40 characters. Please contact with the administrator.")]
        public string CoordinatorEmailAddress { get; set; }

        [Display(Name = "Data modyfikacji")]
        [DataType(DataType.DateTime)]
        [DisplayFormat(DataFormatString = "{0:dd-MM-yyyy HH:mm}", ApplyFormatInEditMode = true)]
        public DateTime Modified { get; set; }

        [Display(Name = "Adress IP")]
        [DataType(DataType.Text)]
        [StringLength(50)]
        public string IpAddress { get; set; }

        public Club Club { get; set; }
        public ICollection<Project> Projects { get; set; }
    }
}